// postgres_io_binary.h : binary input and output from postgreSQL database
//

#if !defined(TRANSFER_DATA_TO_POSTGRES)
#define TRANSFER_DATA_TO_POSTGRES

#include <iosfwd>
#include <string>
#include <vector>
#include <deque>
#include "panda.h"
//#include "components/pg_db_cursor.h"

class t_pg_cursor;

bool pg_remove_PIs_from_table(t_pg_cursor& pg_db,
	 							const std::string& table_name,
	 							const std::deque<t_id>& vec_PIs,
								std::ostream& VERBOSE,
								std::ostream& CERR,
								std::string archived_columns = std::string());
bool pg_export_PIs_to_table(	t_pg_cursor& pg_db,
								const std::string& table_name,
								const std::deque<t_id>& vec_PIs,
								std::ostream& VERBOSE,
								std::ostream& CERR);
bool pg_import_PIs_from_table(	t_pg_cursor& pg_db,
								const std::string& table_name,
								std::deque<t_id>& vec_PIs,
								unsigned PI_cnt_estimate,
								std::ostream& VERBOSE,
								std::ostream& CERR);

bool get_pgsql_sequence_currval(	t_pg_cursor&		pg_db,
									const std::string&	sequence_name,
									t_id&				current_value,
									std::ostream& 		CERR);
bool set_pgsql_sequence_currval(	t_pg_cursor&		pg_db,
									const std::string&	sequence_name,
									const t_id&			new_value,
									std::ostream& 		CERR);


#endif //TRANSFER_DATA_TO_POSTGRES
